package org.dwpd;

import io.lettuce.core.ReadFrom;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@MapperScan("org.dwpd.mapper")
@SpringBootApplication
public class LpyxPcApplication {
    public static void main(String[] args) {
        SpringApplication.run(LpyxPcApplication.class, args);
    }

    @Bean
    public RestHighLevelClient client() {
        return new RestHighLevelClient(RestClient.builder(
//                HttpHost.create("http://114.132.182.51:9200") // 开发环境
                HttpHost.create("http://localhost:9200") // 生产环境
        ));
    }
}
